#include "Quote.h"
#include "Bulk_quote.h"
#include <iostream>
/**
 * @brief 计算并打印销售给定数量的某种书籍所得的费用
 * 
 * @param os 
 * @param item 
 * @param n 
 * @return double 
 */
double print_total(std::ostream &os, Quote *item, size_t n)
{
    // 根据传入 item 形参的对象类型调用 Quote::net_price 或者 Bulk_quote::net_price
    double ret = item->net_price(n);
    os << "ISBN: " << item->isbn() << " # sold " << n << " total due: " << ret << std::endl;
    return ret;
 }